<template>
  <span v-if="multiple" v-loading="loading">
    <span v-if="errorMsg" class="global-gray">{{errorMsg}}</span>
    <a-checkbox v-if="dataRows.length" v-model="checkedAll" @change="doCheckAll">全选</a-checkbox>
    <div></div>
    <a-checkbox-group v-model="checkedKeys">
      <a-checkbox v-for="row in dataRows" :key="row.id" :value="row.id" @change="doCheckChange">{{row.name}}</a-checkbox>
    </a-checkbox-group>
  </span>
  <span v-else v-loading="loading">
    <span v-if="errorMsg" class="global-gray">{{errorMsg}}</span>
    <a-radio-group v-model="selectedKey" @change="doRadioChange">
      <a-radio v-for="row in dataRows" :key="row.id" :value="row.id">{{row.name}}</a-radio>
    </a-radio-group>
  </span>
</template>
<script>
import TreeSelectJS from './ListSelect.js'
export default {
  name: 'ListSelect',
  mixins: [TreeSelectJS]
}
</script>
